package com.sikaryofficial.backend.domain.mapping;

import com.sikaryofficial.backend.domain.dto.req.points.PointsRuleReq;
import com.sikaryofficial.backend.domain.dto.resp.points.PointsRuleDTO;
import com.sikaryofficial.backend.domain.dto.resp.points.PointsRuleTaskDTO;
import com.sikaryofficial.backend.domain.dto.resp.points.UserPointsTaskDTO;
import com.sikaryofficial.backend.domain.entity.PointsRule;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author : qinjinyuan
 * @desc : 积分规则映射
 * @date : 2023/10/31 19:53
 */
@Mapper
public interface PointsRuleMapping {

    PointsRuleMapping INSTANCE = Mappers.getMapper(PointsRuleMapping.class);

    /**
     * 把entity对象 转为DTO
     *
     * @param pointsRule
     * @return
     */
    PointsRuleDTO coverToDto(PointsRule pointsRule);
    /**
     *
     * @param pointsRule
     * @return
     */
    List<PointsRuleDTO> coverToDtoList(List<PointsRule> pointsRule);

    /**
     * 把req对象 转为entity
     *
     * @param pointsRule
     * @return
     */
    PointsRule coverToEntity(PointsRuleReq pointsRule);

    /**
     * 把ruleDto对象映射成
     * @param pointsRuleDTO
     * @return
     */
    PointsRuleTaskDTO coverDtoToTask(PointsRuleDTO pointsRuleDTO);

}
